package com.ts.api.module.api.convert.org.convert;

import com.gitee.apanlh.util.base.Eq;
import com.ts.api.module.api.convert.core.annotation.ApiPlan;
import com.ts.api.module.api.convert.core.annotation.ApiPlanConvertType;
import com.ts.api.module.api.convert.core.context.ApiConvertRegister;
import com.ts.api.module.api.convert.org.handler.ApiOrgPhoneMd5ConvertHandler;
import org.springframework.stereotype.Component;

/**
 *  API机构/平台上下文
 *
 *  @author Pan
 */
@Component
public class ApiOrgPhoneMd5Convert extends ApiConvertRegister<ApiOrgPhoneMd5ConvertHandler, ApiPlan> {

    /**
     *  默认构造函数
     */
    public ApiOrgPhoneMd5Convert() {
        super(
            ApiOrgPhoneMd5ConvertHandler.class,
            ApiPlan.class,
            (annotation) -> Eq.enums(annotation.type(), ApiPlanConvertType.ORG_PHONE_MD5)
        );
    }

    @Override
    public String extractKey(ApiPlan annotation) {
        return annotation.productId();
    }
}

